package com.gfxy.ms.demo.zhuochengjie.controller;

import com.gfxy.ms.demo.zhuochengjie.pojo.ZhuochengjieSemester;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RequestMapping("/zhuochengjie-semester")
@RestController
public class ZhuochengjieSemesterController {

    @RequestMapping("/list")
    public List<ZhuochengjieSemester> getSemesterLiset(){
        List<ZhuochengjieSemester> semesters = new ArrayList<>();
        ZhuochengjieSemester semester1 = new ZhuochengjieSemester();
        semester1.setId("2020-2021-1");
        semester1.setName("2020-2021学年第一学期");
        semester1.setState(0);
        semester1.setStartDate("2020-08-31");
        semester1.setEndDate("2021-02-28");
        semesters.add(semester1);
        ZhuochengjieSemester semester2 = new ZhuochengjieSemester();
        semester2.setId("2019-2020-2");
        semester2.setName("2019-2020学年第二学期");
        semester2.setState(1);
        semester2.setStartDate("2020-02-07");
        semester2.setEndDate("2020-08-27");
        semesters.add(semester2);

        return semesters;
    }

}
